using System;

namespace PagedDataGridView
{
    /// <summary>
    /// Definition of the data about a page
    /// </summary>
    public class PageData : IPageData
    {
        #region IPageData Members

        public string SortBy { get; set; }
        public int Page { get; set; }
        public int PageSize { get; set; }
        public bool Ascending { get; set; }

        public int Pages
        {
            get { return (int) Math.Ceiling(TotalRows/(float) PageSize); }
        }

        public int StartRow
        {
            get { return Page * PageSize + 1; }
        }

        public int EndRow
        {
            get { return (Page + 1) * PageSize; }
        }

        public long TotalRows { get; set; }

        #endregion
    }
}